<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><fmt:message code="email.title.inbox" /></title><!-- 收件箱 -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="../lib/pagination/style/pagination.css"/>
    <link rel="stylesheet" type="text/css" href="/css/email/inbox.css"/>
    <link rel="stylesheet" type="text/css" href="/css/email/inbox-upright.css"/>

    <link rel="stylesheet" type="text/css" href="/css/main/theme3/fontawesome5.min.css"/>
	<link rel="stylesheet" type="text/css" href="/css/global.css"/>
    <script src="../js/common/language.js"></script>
    <script src="../js/jquery/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
    <%--<script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="../lib/layer/layer.js?20201106" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="../lib/ueditor/ueditor.config.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="../lib/ueditor/ueditor.all.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="../lib/laydate/laydate.js" type="text/javascript" charset="utf-8"></script>--%>
    <script src="../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <%--<script src="/js/ajaxupload.js" type="text/javascript" charset="utf-8"></script>--%>
    <%--<script src="/lib/jquery.form.min.js"></script>--%>
    <script src="../js/jquery/jquery.cookie.js"></script>
    <%--<script src="../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>--%>
    <script src="../js/email/writeMail.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/email/inbox.js" type="text/javascript" charset="utf-8"></script>
    <style>
    body{
    	background:#fff;
    }
        a{text-decoration: none;}
        table{
            /*border-collapse: collapse;*/
            border-color: #ccc;
        }
        .main_left .BTN:hover{background:#c5e9fb;}
        .attachment a{text-decoration: none;}
        .attachment a img{vertical-align: middle;}
        .befor .searchTxt{width:70%;height:30px;padding-left:5px;margin-bottom:5px;}
        .UP_INBOX .tab table .Hover:hover{background-color:#c5e9fb;}
        .Hover img{width:16px;}
        .on_tr{background-color: #c5e9fb !important;}
        .UP_INBOX,.UP_INBOX .tab,.UP_INBOX .tab table{width: 99%;}
        .UP_INBOX .tab table tr{border: 1px solid #c0c0c0;}
        .UP_INBOX .tab table tr th{color: #2F5C8F;font-weight: normal;}
        .UP_INBOX .tab table tr:nth-child(odd){background-color: #fff;}
        .UP_INBOX .tab table tr:nth-child(even){background-color: #F6F7F9;}
        .UP_INBOX .tab table tr th,.UP_INBOX .tab table tr td{padding:10px;}
        .UP_INBOX,.UP_INBOX .tab,.UP_INBOX .tab table tr th.theme{text-align: center}
        .UP_INBOX .tab table .theme_a a{text-decoration: none;text-align: left;display: block;color:#2B7FE0;}
        .M-box3{margin-top:10px;float:right;margin-right: 7px;}
        .M-box3 a{margin: 0 3px;width: 29px;height: 29px;line-height: 29px;font-size: 12px;text-decoration: none;}
        .M-box3 .active{margin: 0px 3px;width: 29px;height: 29px;line-height: 29px;background: #2b7fe0;font-size: 12px;border: 1px solid #2b7fe0;}
        .jump-ipt{margin: 0 3px;width: 29px;height: 29px;line-height: 29px;font-size: 12px;}
        .M-box3 a:hover{background: #2b7fe0;}
        .set_up_ul{font-size: 14px;border: #ccc 1px solid;border-radius: 5px;width: 80%;background-color: #fff;position: absolute;bottom: 42px;margin-left: 5px}
        .set_up_ul ul{list-style: none;}
        .set_up_ul ul li{width: 100%;text-align: center;color: #000;height:25px;line-height:25px;}
        .set_up_ul ul li:hover{background-color: #1f73b7;color:#fff;cursor: pointer;}
        .RemoveTo_div{font-size: 12px;border: #ccc 1px solid;border-radius: 5px;min-width:160px;background-color: #fff;position: absolute;left:0px;top: 30px;z-index: 9999;}
        .RemoveTo_div ul li{padding: 5px 10px;display:block;clear: both;}
        .RemoveTo_div .RemoveTo_child:hover{background-color: #6ea1d5;color:#fff;cursor: pointer;}
        .RemoveTo_div .noCustom:hover{background-color: #6ea1d5;color:#fff;cursor: pointer;}
        .allEmail_div{
            font-size: 12px;
            border: #ccc 1px solid;
            border-radius: 6px;
            min-width: 115px;
            background-color: #fff;
            position: absolute;
            top: 52px;
            z-index: 9999;
        }

        
        .allEmail_div ul li{padding: 5px 10px;display:block;clear: both;}
        .allEmail_div ul li:hover{background-color: #6ea1d5;color:#fff;cursor: pointer;}
        textarea{width: 230px;height: 50px;margin: 5px;}
        .noEmail_img{width: 163px;height: 162px;margin: 170px auto;}
        .noContent{width: 50px;margin: 200px auto;}
        .main_right table tr td>span>span{
            float: left;
        }
       
           
        
        .main .main_left ul li .xia img{
            float: none;
            position: absolute;
            margin-right: 0;
            right: 8%;
        }
        .inbox_btn_tim{
            height: 52px;
        }
        .page .page_left .inbox_btn{
            height: 52px;
            line-height: 52px;
        }
        img[src=""],img:not([src]){opacity:0;}
        .up_page_right{
            /*overflow-y: hidden;*/
            overflow-x: auto;
            height: 99% !important;
        }
        .up_page_right .up_header{
            min-width: 918px;
        }
        /*.main{overflow: hidden}*/
        input{background:none}
        .ul_showtwo{
            background: #0067a9;
        }
        .divUlShow{
            background: #6596c8;
        }
        .div_down{
            background: url(/img/icon_more_dakai_07.png) no-repeat 75% center;
            background-size: 13px 12px;
        }
        .main_middle{
            position: absolute;
            float: left;
            width: 8px;
            height: 100%;
            background: #cee7ff;
            left:28%;
            cursor: col-resize;
            z-index: 10;
        }
        #allEmail {
            display: none !important;
        }
        #divTbaleText{
            border-collapse: collapse;
        }
        #divTbaleText tr{
            border:#ccc 1px solid;
        }
        #divTbaleText tr th{
            padding: 5px;
        }
        #divTbaleText tr td{
            padding: 5px;
        }
        .up_page_right .up_header .up_nav>ul>li{
            position: relative;
            z-index: 10;
            width: 60px;
        }
        .up_page_right .up_header{
            width:99%;
        }

        /*定义菜单滚动条*/
        .up_page_right::-webkit-scrollbar
        {
            display: none;
        }

        .edui-for-justifyjustify + .edui-separator,
        .edui-for-tolowercase + .edui-separator,
        .edui-for-anchor + .edui-separator,
        .edui-for-imagecenter + .edui-separator,
        .edui-for-background + .edui-separator,
        .edui-for-wordimage + .edui-separator,
        .edui-for-charts + .edui-separator,
        .edui-for-wordimport + .edui-separator,
        div.edui-box.edui-for-touppercase,
        div.edui-box.edui-for-tolowercase,
        div.edui-box.edui-for-link,
        div.edui-box.edui-for-unlink,
        div.edui-box.edui-for-anchor,
        div.edui-box.edui-for-imagenone,
        div.edui-box.edui-for-imageleft,
        div.edui-box.edui-for-imageright,
        div.edui-box.edui-for-imagecenter,
        div.edui-box.edui-for-simpleupload,
        div.edui-box.edui-for-insertimage,
        div.edui-box.edui-for-emotion,
        div.edui-box.edui-for-scrawl,
        div.edui-box.edui-for-insertvideo,
        div.edui-box.edui-for-music,
        div.edui-box.edui-for-attachment,
        div.edui-box.edui-for-map,
        div.edui-box.edui-for-gmap,
        div.edui-box.edui-for-insertframe,
        div.edui-box.edui-for-insertcode,
        div.edui-box.edui-for-webapp,
        div.edui-box.edui-for-pagebreak,
        div.edui-box.edui-for-template,
        div.edui-box.edui-for-background,
        div.edui-box.edui-for-horizontal,
        div.edui-box.edui-for-date,
        div.edui-box.edui-for-time,
        div.edui-box.edui-for-spechars,
        div.edui-box.edui-for-snapscreen,
        div.edui-box.edui-for-wordimage,
        div.edui-box.edui-for-inserttable,
        div.edui-box.edui-for-deletetable,
        div.edui-box.edui-for-insertparagraphbeforetable,
        div.edui-box.edui-for-insertrow,
        div.edui-box.edui-for-deleterow,
        div.edui-box.edui-for-insertcol,
        div.edui-box.edui-for-deletecol,
        div.edui-box.edui-for-mergecells,
        div.edui-box.edui-for-mergeright,
        div.edui-box.edui-for-mergedown,
        div.edui-box.edui-for-splittocells,
        div.edui-box.edui-for-splittorows,
        div.edui-box.edui-for-splittocols,
        div.edui-box.edui-for-charts,
        div.edui-box.edui-for-print,
        div.edui-box.edui-for-preview,
        div.edui-box.edui-for-searchreplace,
        div.edui-box.edui-for-help,
        div.edui-box.edui-for-drafts,
        div.edui-box.edui-for-wordimport {
            display: none !important;
        }

         @-moz-document url-prefix(){.div_quan {
            display: inline-block;
            height: 20px;
            width: 20px;
            background-color: #fff !important;
            line-height: 20px;
            color: #2b7edf;
            text-align: center;
            border-radius: 15%;
            font-size: 12px;
            margin-left: 77px;
        }}
	
	
@media screen and (-webkit-min-device-pixel-ratio:0) {
		.div_quan {
            display: inline-block;
            height: 20px;
            width: 20px;
            background-color: #fff !important;
            line-height: 20px;
            color: #2b7edf;
            text-align: center;
            border-radius: 15%;
            font-size: 12px;
            margin-left: 77px;
        }}
		
    </style>

    <script type="text/javascript" src="../js/spirit/qwebchannel.js"></script>
    <link rel="stylesheet" type="text/css" href="/css/commonTheme/${sessionScope.InterfaceModel}/commonTheme.css"/>
    <script>
        $(function () {
            if($('#InBox').find('img').prop('src').indexOf('theme20')==-1){
                if($('#InBox').find('img').prop('src').indexOf('theme2')!=-1||$('#InBox').find('img').prop('src').indexOf('theme4')!=-1){
                    $('#InBox').find('img').prop('src','/img/commonTheme/${sessionScope.InterfaceModel}/icon_inbox_07-.png')
                    $('.ul_showtwo ul>li').click(function () {
                        if($(this).hasClass('on')){
                            if($(this).find('img').prop('src').indexOf('-')==-1) {
                                $(this).siblings('li').each(function (i,n) {
                                    $(this).find('img').prop('src',$(this).find('img').prop('src').replace(/-/g,''))
                                })
                                $(this).parents('.inBox').next().find('.divUlShow').find('li').each(function () {
                                    $(this).find('img').prop('src',$(this).find('img').prop('src').replace(/-/g,''))

                                })


                                $(this).find('img').prop('src', $(this).find('img').prop('src').split('.png')[0] + '-' + '.png')
                            }
                        }
                    })
                    $(document).on('click','.divUlShow>ul>li',function () {
                        if($(this).hasClass('on')){
                            if($(this).find('img').prop('src').indexOf('-')==-1) {
                                $(this).siblings('li').each(function (i,n) {
                                    $(this).find('img').prop('src',$(this).find('img').prop('src').replace(/-/g,''))
                                })
                                $(this).parents('.other').prev().find('.ul_showtwo').find('li').each(function () {
                                    $(this).find('img').prop('src',$(this).find('img').prop('src').replace(/-/g,''))

                                })


                                $(this).find('img').prop('src', $(this).find('img').prop('src').split('.png')[0] + '-' + '.png')
                            }
                        }
                    })
                }
            }
        })
    </script>
</head>
<link rel="stylesheet" type="text/css" href="/css/email/index.css"/>
<link rel="stylesheet" type="text/css" href="/css/global.css"/>
<body>
<div class="page">

    <!--左侧侧边栏 开始-->
    <div class="page_left">
        <!--写邮件-->
        <div class="write">
            <div class="d_im g_button_z_1z g_button_z_1z_xie"><span>写</span>
            </div>
        </div>
        <!--收件箱-->
        <div class="inBox">
            <a href="javascript:;" class="inbox_btn" style="display:none">
                <div class="inbox_btn_tim div_down" ><fmt:message code="email.title.mailbox" /></div>
            </a>
            <div class="ul_show ul_showtwoul_show ul_showtwo" style="display: block;">
                <ul>																																							<!---<span id="inboxNum"></span>-->
                    <li id="InBox" flag="1" class="on Inbox"><a href="javascript:;"><img src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_inbox_07.png" width="19" height="19px"/><fmt:message code="email.title.inbox" /><div id="unreadNum" class="div_quan"></div></a></li>
                    <li id="drafts" flag="2"><a href="javascript:;"><img src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_drafts_07.png" width="19" height="19px"/><fmt:message code="email.title.draftbox" /><div id="draftsNum" class="div_quan" style="margin-left: 80px;"></div></a></li>
                    <li id="hasBeenSend" flag="3"><a href="javascript:;"><img src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_sent_07.png" width="19" height="19px"/><fmt:message code="email.title.sent" /><div id="hasBeenSendNum" class="div_quan"></div></a></li>
                    <li id="wastebasket" flag="4"><a href="javascript:;"><img src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_dustbin_07.png" width="19" height="19px"/><fmt:message code="email.title.wastebasket" /><span id="wastebasketNum"></span></a></li>
                    
                </ul>
            </div>
        </div>
        <!--其他邮件箱-->
        <div class="other">
            <a href="javascript:;" class="inbox_btn">
                <div class="inbox_btn_tim div_up"><fmt:message code="email.title.othermailbox" /></div>
            </a>
            <div class="ul_show divUlShow" >
                <ul>
                    <%--<li><a href="javascript:;"><img src="../img/icon_file_11.png"/><fmt:message code="email.title.oneselffile" /></a></li>--%>
                </ul>
            </div>

        </div>
        <!--邮箱设置-->
        <div class="setUp">
            <a href="javascript:;" class="aSeting">
                <img class="setUp_img" src="../img/icon_setmail_11.png" width="20px" height="20px"/>
                <span><fmt:message code="email.th.mailimpost" /></span>
            </a>
            <a href="javascript:;" class="aReflresh" >
                <img class="loding" src="../img/icon_refresh_11.png" width="20px" height="20px"/>
            </a>
            <div class="set_up_ul" style="display:none;">
                <ul>
                    <li class="exceptLi"><fmt:message code="Email.th.Manageboxes" /></li>
                    <li class="externalMail">Internet邮箱</li>
                    <%--<li>导入Internet邮箱</li>
                    <li>邮箱整理</li>
                    <li>POP3设置</li>--%>
                </ul>
            </div>
        </div>
    </div>

    <!--左侧侧边栏 结束-->

    <!--右侧侧边栏 开始-->
    <div class="up_page_right">
        <div class="up_header">
            <div class="up_nav">
                <ul>
				<li class='liSearch g_button_f_1z g_button_z_select'><img style="display:none" src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_search_03.png" width="19" height="19px"/>查</li>
                    <li id="allEmail" class="g_button_z" style="width: 100px"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_allmail_06.png" class="im"/><fmt:message code="email.th.allmail" /><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_more_06.png" class="more_im"/></li>
                    <!--<li id="unread"  style="margin-right: 22%;width: 90px"><img src="../img/icon_notread_06.png" class="im"/><fmt:message code="email.th.unread" /><span id="unreadNum">0</span></li>-->
                    <li id="recover" class="g_button_z" style="display: none;"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_replay_03.png" class="im"/>恢复</li>
                    <li id="withdraw" class="g_button_f_1z g_button_z_hui" style="display: none;"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_replay_03.png" class="im"/>撤</li>
                    <li id="sendAgain" class="g_button_z_2z g_button_z_send" style="display: none;"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_sendAgain.png" class="im"/>再发</li>

                    <li id="Replay" class="g_button_f_1z g_button_z_1z_hui"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_replay_03.png" class="im"/>回</li>
                    <!--<li id="ReplayAll"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_replayAll.png" class="im"/><fmt:message code="email.th.replyall" /></li>-->
                    <li id="Forward" class="g_button_f_1z g_button_z_1z_zhuan" data-boxType="inbox"><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_transmit_06.png" class="im"/>转</li>
                    <!--<li id="RemoveTo" style="position: relative;">
                        <img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_move_06.png" class="im"/><fmt:message code="email.th.remove" /><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_more_06.png" class="more_im"/>
                        <div class="RemoveTo_div" style="display:none;">
                            <ul>
                                <li class="noCustom">无自定义邮件箱</li>
                            </ul>
                        </div>
                    </li>-->
                    <li id="delete" class="g_button_f_1z g_button_z_1z_del" dataHeng="" data-deleteType="inbox" data-defats="otherBox" data-box=""><img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_delete_06.png" class="im"/>删</li><%--<img src="../img/icon_more_06.png" class="more_im"/>--%>
                    <%--<li onclick="clicked()"><fmt:message code="email.th.more" /><img src="../img/icon_more_06.png" class="am"/></li>--%>
                </ul>

                <div class="allEmail_div" style="display:none;">
                    <ul>
                        <li attrAll=""><fmt:message code="email.th.allmail" /></li>
                        <li attrAll="0"><fmt:message code="workflow.th.Internalmail" /></li>
                        <%--<li attrAll="1"><fmt:message code="workflow.th.ExternalMail" /></li>--%>
                    </ul>
                </div>
            </div>
            <div class="up_pages">
                <%--<div class="up_div_pages">
                <ul>
                    <li onclick="clicked()"><img src="../img/icon_left_03.png"/><fmt:message code="email.th.beforemail" /><span>|</span></li>
                    <li onclick="clicked()"><fmt:message code="email.th.nextmail" /><img src="../img/icon_right_03.png"/></li>
                </ul>
            </div>--%>
                <div class="up_format">
                    <ul>
                        <li class="for_on"><span class="fa-list" id="ul_imgs"></span></li>
                        <li><span class="fa-align-justify" id="ul_img"></span></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="iframe" style="display:block;">
            <iframe src="/email/emailList?boxStyle=inbox" id="iframeEmailList" frameborder="0" style="width: 100%;height: 100%;min-width: 918px;"></iframe>
        </div>
        <div class="iframeUp" style="display:none;">
            <iframe src="/email/inBoxUp" id="iframeEmailListUp" frameborder="0" style="width: 100%;height: 100%;"></iframe>
        </div>
    </div>
    <div class="div_iframeTwo" style="display: none;overflow:hidden;float: left;height: 100%;"><div id="iframe1" class="iframe1" style="width: 100%;height: 100%;">
        <%--<iframe  id="iframeids" src="mailQuery" frameborder="0" height="100%" width="100%" noresize="noresize"></iframe>--%>
    </div></div>

</div>

<script type="text/javascript">
    var user = 'senduser';
    var user_id='';
    //var ue = UE.getEditor('container');
    var res;
    var otherBoxId;
    var userId = $.cookie('userId');
    if(userId == null){
        $.ajax({
            type: "post",
            url: "/users/getUserTheme",
            dataType: 'json',
            async:false,
            success: function (res) {
                var data = res.object;
                userId = data.userId;
            }
        })
        $.cookie('userId',userId,{expires: 7})
    }
    $(function () {
        var main_height = $(document).height() - 65;
        var rightWidth=$('.page').width()-$('.page_left').width() - 2;
//                $('.main_left').height(main_height);
        $('.main_middle').height(main_height);
        var heights = main_height - 194;
        $('.article').height(heights);
        var upBoxHeight=$('.up_page_right').height()-$('.up_header').height();
        $('.iframe').height(upBoxHeight-5)
        $('.iframeUp').height(upBoxHeight)
        window.onresize=function(){
            var upBoxHeight=$('.up_page_right').height()-$('.up_header').height();
            $('.iframe').height(upBoxHeight-5)
            $('.iframeUp').height(upBoxHeight)
        }
        // $('.up_page_right').width($('.page').width()-$('.page_left').width());
        //与写邮件页面互调
        $('.d_im').click(function () {
            $.ajax({
                url:'/userCountPer',
                dataType:'json',
                type:'get',
                success:function(res){
                    if(res.flag){
                        $('.page').find('.div_iframe').remove();
                        var Ifrmae = '<div class="div_iframe" style="overflow: hidden;height: 98%;"><div id="iframe1" class="iframe1" style="width: 100%;height: 100%;"><iframe  id="iframeId" src="addbox" frameborder="0" scrolling="yes" height="100%" width="100%" noresize="noresize"></iframe></div></div>';
                        $('.up_page_right').css('display', 'none');
                        $('.page').append(Ifrmae);
                        $('.div_iframeTwo').css('display', 'none')
                        $('.div_iframeOne').css('display', 'none');
                    }else{
                        $.layerMsg({content:'人数达到上限，不能写邮件',icon:6})
                    }
                }
            })
//				    $(this).css('background','url("../../img/email/icon_email_click_01.png") no-repeat');

        });
        $('.Inbox').click(function () {
            $('.page').find('.div_iframe').remove();
            $('.up_page_right').css('display', 'block');
        });

//                切换收件箱显示风格
        $('.up_format li').click(function(){
            var indexNum=$(this).index();
			
            if(indexNum == 0){
				
                $('.iframe').show();
                $('.iframeUp').hide();
                $('.up_format li').eq(0).addClass('for_on').find('span').attr('class','fa-list');
                $('.up_format li').eq(1).removeClass('for_on').find('span').attr('class','fa-align-justify');
                //$('#delete').attr('dataHeng','');
            }else{
				
                $('.iframe').hide();
                $('.iframeUp').show();
                $('.up_format li').eq(0).removeClass('for_on').find('span').attr('class','fa-list2');
                $('.up_format li').eq(1).addClass('for_on').find('span').attr('class','fa-align-justify2');
                $('#delete').attr('dataHeng','true');
            }
        })

        //点击切换邮件箱管理页面（邮箱设置）
        $('.exceptLi').click(function () {
            $('.page').find('.div_iframeOne').remove();
            $('.up_page_right').css('display', 'none');
            var Ifrmae = '<div class="div_iframeOne" style="width: '+rightWidth+'px;overflow-y: hidden;overflow-x: hidden;float: left;height: 100%;"><div id="iframe1" class="iframe1" style="width: 100%;height: 100%;"><iframe name="myFrame" id="iframe_id" src="manageMail" frameborder="0" height="100%" width="100%" noresize="noresize"></iframe></div></div>';
            $('.page').append(Ifrmae);
            $('.div_iframeTwo').css('display', 'none');
            $('.div_iframe').css('display', 'none');
            document.getElementById("iframe_id").onload = function () {
                myFrame.window.divListShow();
            };
        })
        //点击切换外部邮件箱 --- internet邮箱
        $('.externalMail').click(function () {
            $('.page').find('.div_iframeOne').remove();
            $('.up_page_right').css('display', 'none');
            var Ifrmae = '<div class="div_iframeOne" style="width: '+rightWidth+'px;overflow-y: hidden;overflow-x: hidden;float: left;height: 100%;"><div id="iframe1" class="iframe1" style="width: 100%;height: 100%;"><iframe name="myFrame" id="iframe_id" src="/email/internetEmailList" frameborder="0" height="100%" width="100%" noresize="noresize"></iframe></div></div>';
            $('.page').append(Ifrmae);
            $('.div_iframeTwo').css('display', 'none');
            $('.div_iframe').css('display', 'none');
            $('#withdraw').css('display', 'none');
            $('#recover').css('display', 'none');
            document.getElementById("iframe_id").onload = function () { //控制子页面的方法
                myFrame.window.showDiv();
            };
        })

        //查询邮件点击事件
        $('.liSearch').click(function () {
//                    $('.page').find('.div_iframeTwo').remove();
//                    var Ifrmae = '<div class="div_iframeTwo" style="width: '+rightWidth+'px;overflow:hidden;float: left;height: 100%;"><div id="iframe1" class="iframe1" style="width: 100%;height: 100%;"><iframe  id="iframeids" src="mailQuery" frameborder="0" height="100%" width="100%" noresize="noresize"></iframe></div></div>';
//                    $('.page').append(Ifrmae);
            $('.div_iframeTwo').show().css('width', rightWidth+'px');
            $('.up_page_right').css('display', 'none');
            $('.div_iframeOne').css('display', 'none');
            $('.div_iframe').css('display', 'none');
            var iframestr = '<iframe  id="iframeids" src="mailQuery" frameborder="0" height="100%" width="100%" noresize="noresize"></iframe>';
            $('.div_iframeTwo').html(iframestr);
        });
        //收件箱点击事件
        $('#InBox').click(function () {

            $('#iframeEmailList').attr('src', '/email/emailList?boxStyle=inbox');
            $('#Forward').attr('data-boxType','inbox');
            $('.up_nav').find('li').css('display','block');
            $('.up_pages').css('display','block');
            $('#withdraw').css('display','none');
            $('#recover').css('display', 'none');
            $('#sendAgain').css('display','none');
            $('#delete').attr('data-deleteType','inbox');
            //$('#delete').attr('dataHeng','');
            $('.iframeUp').hide();
            $('.iframe').show();
        });
//                未读点击
        $('#unread').click(function () {
            $('#iframeEmailList').attr('src', '/email/emailList?boxStyle=unreadBox');
            $('#Forward').attr('data-boxType','inbox');
            $('.up_nav').find('li').css('display','block');
            $('.up_pages').css('display','block');
            $('#withdraw').css('display','none');
            $('#recover').css('display', 'none');
            $('#sendAgain').css('display','none');
            $('#delete').attr('data-deleteType','unreadBox');
            //$('#delete').attr('dataHeng','');
            $('.iframeUp').hide();
            $('.iframe').show();
            $('#InBox').addClass("on").siblings().removeClass("on");

        })


        //草稿箱点击事件
        $('#drafts').click(function () {

            $('#iframeEmailList').attr('src', '/email/emailList?boxStyle=drafts');
            $('#recover').css('display', 'none');
            $('#delete').attr('data-deleteType','drafts');
            $('#allEmail').css('display','block');
            $('#delete').css('display','block');
            $('#Replay').css('display','none');
            $('#ReplayAll').css('display','none');
            $('#sendAgain').css('display','none');
            $('#Forward').css('display','none');
            $('#RemoveTo').css('display','none');
            $('.div_iframeOne').css('display','none');
            $('.up_page_right').css('display','block');
            $('.up_pages').css('display','none');
            $('#withdraw').css('display','none');
            //$('#delete').attr('dataHeng','');
            $('.iframeUp').hide();
            $('.iframe').show();
        });

        //已发送点击事件
        $('#hasBeenSend').click(function () {
            $('#befor').empty();
            $('#iframeEmailList').attr('src', '/email/emailList?boxStyle=outbox');
            $('#Forward').attr('data-boxType','outbox');
            $('#delete').attr('data-deleteType','outbox');
            $('#recover').css('display', 'none');
            selectBox = 'hasBeenSend';
            showAndHide();
            $('#Forward').css('display', 'block');
            $('#withdraw').css('display', 'block');
            $('#sendAgain').css('display', 'block');
            $('#delete').css('display', 'block');
            $('#Replay').css('display', 'none');
            $('#ReplayAll').css('display', 'none');
            $('#RemoveTo').css('display', 'none');
            $('.div_iframeOne').css('display', 'none');
            $('.up_page_right').css('display', 'block');
            $('.up_pages').css('display', 'none');
            //$('#delete').attr('dataHeng','');
            $('.iframeUp').hide();
            $('.iframe').show();
        });

        //废纸篓点击事件
        $('#wastebasket').click(function () {

            $('#iframeEmailList').attr('src', '/email/emailList?boxStyle=recycle');
            $('#delete').attr('data-deleteType','recycle');
            $('#recover').css('display', 'block');
            $('#allEmail').css('display', 'block');
            $('#withdraw').css('display', 'none');
            $('#delete').css('display', 'block');
            $('#Replay').css('display', 'none');
            $('#ReplayAll').css('display', 'none');
            $('#sendAgain').css('display', 'none');
            $('#Forward').css('display', 'none');
            $('#RemoveTo').css('display', 'none');
            $('.div_iframeOne').css('display', 'none');
            $('.up_page_right').css('display', 'block');
            $('.up_pages').css('display', 'none');
            $('#delete').attr('dataHeng','');
            $('.iframeUp').hide();
            $('.iframe').show();

        });
        $('.page_left').on('click', '.otherLi', function () {
            $('.page_left li').removeClass('on');
            $(this).addClass('on');
            otherBoxId = $(this).attr('boxid');
        })

        //删除事件
        $('#delete').click(function () {
            var dataHengNum=$(this).attr('dataHeng');
            var boxStyle=$(this).attr('data-deletetype');
            var bodyId='',ueId='',boxId='',emailId='';
            var defatsStyle=$(this).attr('data-defats');
            var arrId1=[];
            var arrId2=[];
            var arrId3=[];
            if($('.iframeUp').css('display') == 'block'){
                emailId=$("#iframeEmailListUp").contents().find(".tab .backList").attr('Attr');
				
				ueId=$("#iframeEmailListUp").contents().find(".tab .backList").attr('uId');
                $("#iframeEmailListUp").contents().find(".checkboxChild:checkbox:checked").each(function(){
                    var sId=$(this).parents('.Hover').attr('Attr');
                    arrId1.push(sId);
                })
                $("#iframeEmailListUp").contents().find(".checkboxChild:checkbox:checked").each(function(){
                    var ueID=$(this).parents('.Hover').attr('uId');
                    arrId2.push(ueID);
                })
				
            }else{
				emailId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id');
				
				bodyId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('nId');
                ueId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('ueId');
                boxId=$(this).attr('data-box');
                $("#iframeEmailList").contents().find(".chekEmail:checkbox:checked").each(function(){
					
                    var sId=$(this).parents('.BTN').find('input[type="hidden"]').attr('id');
                    arrId1.push(sId);
                })
                $("#iframeEmailList").contents().find(".chekEmail:checkbox:checked").each(function(){
                    var ueID=$(this).parents('.BTN').find('input[type="hidden"]').attr('ueId');
                    arrId2.push(ueID);
                })
                $("#iframeEmailList").contents().find(".chekEmail:checkbox:checked").each(function(){
                    var bodyId=$(this).parents('.BTN').find('input[type="hidden"]').attr('nId');
                    arrId3.push(bodyId);
                })
				
            }
            var data0={
                "flag":"inbox",
                "page":1,
                "pageSize":10,
                "useFlag":true
            }

            var data1={
                "flag":'inbox',
                "page":1,
                "pageSize":15,
                "useFlag":true,
                "searchCriteria":'',
                "orderByName":'',
                "orderWhere":'',
                "isWebmail":''
            };
            var data2={
                "flag":'drafts',
                "page":1,
                "pageSize":15,
                "useFlag":true,
                "searchCriteria":'',
                "orderByName":'',
                "orderWhere":''
            };
            var data3={
                "flag":'outbox',
                "page":1,
                "pageSize":15,
                "useFlag":true,
                "searchCriteria":'',
                "orderByName":'',
                "orderWhere":'',
                "isWebmail":''
            };
            var data4={
                "flag":'recycle',
                "page":1,
                "pageSize":15,
                "useFlag":true,
                "searchCriteria":'',
                "orderByName":'',
                "orderWhere":'',
                "isWebmail":''
            };
            var data5={
                'page':1,
                'pageSize':15,
                'useFlag':false,
                'boxId': boxId,
                "searchCriteria":'',
                "orderByName":'',
                "orderWhere":''
            }
            var data={
                "flag":boxStyle,
                "emailID":emailId,
                "deleteFlag":ueId
            }
            var dataCheck={
                "flag":boxStyle,
                "requestFlags":arrId1,
                "deleteFlags":arrId2
            }
			
            if(dataHengNum == 'true'){
                deleteData(dataCheck,boxStyle,data0,dataHengNum);
				
            }else{
                if($("#iframeEmailList").contents().find(".befor .chekEmail").css('display') == 'inline-block'){
                    if(boxStyle == 'inbox'){//收件箱
                        deleteData(dataCheck,boxStyle,data1,dataHengNum);
                    }else if(boxStyle == 'drafts'){
                        var draftsData={
                            requestFlags:arrId3
                        }
                        deleteDrafts(draftsData,data2,dataHengNum);
                    }else if(boxStyle == 'outbox'){//发送箱
                        dataCheck.requestFlags=arrId3;
                        deleteData(dataCheck,boxStyle,data3,dataHengNum);
                    }else if(boxStyle == 'recycle'){
                        deleteData(dataCheck,boxStyle,data4,dataHengNum);
                    }else if(boxStyle == 'otherBox'){
                        dataCheck.flag='inbox';
                        deleteData(dataCheck,'otherBox',data5,dataHengNum);
                    }
                }else{
					
                    if(boxStyle == 'inbox'){
                        deleteData(data,boxStyle,data1,dataHengNum);
                    }else if(boxStyle == 'drafts'){ //草稿箱
                        var draftsData={
                            bodyId:bodyId
                        }
                        deleteDrafts(draftsData,data2,dataHengNum);
                    }else if(boxStyle == 'recycle'){
                        deleteData(data,boxStyle,data4,dataHengNum);
                    }else if(boxStyle == 'outbox'){
                        data.emailID=bodyId
                        deleteData(data,boxStyle,data3,dataHengNum);
                    }else if(boxStyle == 'otherBox'){
                        data.flag='inbox';
                        deleteData(data,'otherBox',data5,dataHengNum);
                    }
                }
            }

        })
        //恢复事件
        $('#recover').click(function(){

            var toId = userId;
            var bodyId='';
            bodyId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="checkbox"]').attr('emailId')+',';
            if($("#iframeEmailList").contents().find(".befor .backing").find('input[type="checkbox"]').attr('emailId') == undefined){
                bodyId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id')+',';
            }
            var bodyIds='';
            $("#iframeEmailList").contents().find(".befor .BTN").children('input[type="checkbox"]:checked').each(function () {
                var id =$(this).attr('emailId')+ ",";
                if($(this).attr('emailId') == undefined){
                    var id =$(this).prev().attr('id')+ ",";
                }
                bodyIds += id;
            });
            var num='';
            if(bodyIds!=''){
                num=bodyIds
            }else{
                num=bodyId
            }
            layer.confirm('确定恢复此邮件吗', {title:'邮件恢复',
                btn: ['确定','取消'] //按钮
            }, function(){
                $.ajax({
                    type:'get',
                    url:'/email/upDateDiu',
                    dataType:'json',
                    data:{
                        emailId:num,
                        toId:toId
                    },
                    success:function(obj){
                        //第三方扩展皮肤
                        layer.msg('恢复成功', { icon:6});
                        window.location.reload();

                    }
                })
            }, function(){
                layer.closeAll();
            });
        })
        //回复事件
        $('#Replay').click(function () {
            var dataHengNum=$('#delete').attr('dataHeng');
            var sId='';
            if(dataHengNum == 'true'){
                sId=$("#iframeEmailListUp").contents().find(".tab .backList").attr('Attr');
            }else{
                sId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id');
            }
//                    if (typeof(qt) == 'undefined') {
            $.popWindow('writeMailDetail?sId=' + sId + '&type=0', '<fmt:message code="global.lang.reply" />', '0', '0', '1300px', '600px');
        <%--} else {--%>
        <%--alert('111')--%>
        <%--new QWebChannel(qt.webChannelTransport, function (channel) {--%>
        <%--var content = channel.objects.interface;--%>
        <%--content.xoa_sms('/email/writeEmail?sId=' + sId + '&type=0', '<fmt:message code="global.lang.reply" />', "web_child_url");--%>
        <%--});--%>
        <%--}--%>
    });
    //回复全部事件
    $('#ReplayAll').click(function () {
        var dataHengNum=$('#delete').attr('dataHeng');
        var sId='';
        if(dataHengNum == 'true'){
            sId=$("#iframeEmailListUp").contents().find(".tab .backList").attr('Attr');
        }else{
            sId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id');
        }
        window.open('writeMailDetail?sId=' + sId + '&type=1')
        // $.popWindow('writeMailDetail?sId=' + sId + '&type=1');

    })
    //转发事件
    $('#Forward').click(function () {
        var dataHengNum=$('#delete').attr('dataHeng');
        var flag = $('.on').attr('flag')
        var sId='';
        if(dataHengNum == 'true'){
            sId=$("#iframeEmailListUp").contents().find(".tab .backList").attr('Attr');
        }else{
            sId=$("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id');
        }
//                    var sId = $("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('id');
        var nId = $("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('nId');
        var dataBoxType=$(this).attr('data-boxType')
        $.popWindow('writeMailDetail?sId=' + dataUndefind(sId) + '&type=2&nId='+nId+'&boxType='+dataBoxType+'&flag='+flag, '<fmt:message code="email.th.transmit" />', '0', '0', '1300px', '600px');
    })

    //				再次发送点击事件
    $('#sendAgain').click(function () {
        var nId = $("#iframeEmailList").contents().find(".befor .backing").find('input[type="hidden"]').attr('nId');
        $.popWindow('writeEmail?nId=' + nId + '&type=6', '再次发送', '0', '0', '1300px', '600px');
    })
    })

    //ue编辑器清空方法
    function empty(){
        ue.setContent('');
    }

    function dataUndefind(data) {
        if(data == 'undefined'){
            return '';
        }else {
            return data;
        }
    }


    //邮件删除
    function deleteData(data,boxType,datan,use_heng){
        layer.confirm('<fmt:message code="global.lang.sure" />', {title:'<fmt:message code="information" />',
            btn: ['<fmt:message code="global.lang.ok" />','<fmt:message code="depatement.th.quxiao" />'] //按钮
        }, function(){
            //确定删除，调接口
            $.ajax({
                type:'get',
                url:'deleteEmail',
                dataType:'json',
                data:data,
                success:function(){
					
                    if(boxType == 'inbox'){
					
					
                        if(use_heng == 'true'){
                            xianshihengban(datan);
                        }else{
                            btnClick(datan,'showEmail');
                        }
                    }else if(boxType == 'drafts'){
                        btnClick(datan,'drafts');
                    }else if(boxType == 'outbox'){
                        btnClick(datan,'outbox');
                    }else if(boxType == 'recycle'){
                        btnClick(datan,'showEmail');
                    }else if(boxType == 'otherBox'){
                        btnClick(datan,'selectBoxEmail');
                    }
                    //第三方扩展皮肤
                    layer.msg('<fmt:message code="workflow.th.delsucess" />', { icon:6});
					btnClick(datan,'showEmail');
                }
            })
        }, function(){
            layer.closeAll();
        });
    }
    //             草稿箱邮件删除
    function deleteDrafts(data,datan) {
        layer.confirm('<fmt:message code="global.lang.sure" />', {
            btn: ['<fmt:message code="global.lang.ok" />','<fmt:message code="depatement.th.quxiao" />'] //按钮
        }, function(){
            //确定删除，调接口
            $.ajax({
                type:'get',
                url:'deleteDraftsEmail',
                dataType:'json',
                data:data,
                success:function(){
                    //第三方扩展皮肤
                    layer.msg('<fmt:message code="workflow.th.delsucess" />', { icon:6});
                    btnClick(datan,'showEmail');
                }
            }) ;
        }, function(){
            layer.closeAll();
        });
    }

    function btnClick(data,emailUrl) {
        document.getElementById("iframeEmailList").contentWindow.showAjaxPaixu(data,emailUrl);
    }
    function xianshihengban(data) {
        document.getElementById("iframeEmailListUp").contentWindow.hengEmailList(data);
    }

</script>

<script language="javascript" type="text/javascript">
    function parenttest() {
//                $('.other .ul_show ul').empty();
//                $('.up_nav .RemoveTo_div ul').empty();
        var data={
            'page':1,
            'pageSize':10,
            'useFlag':false
        }
        $.ajax({
            type:'GET',
            url:'showEmailBox',
            dataType:'json',
            data:data,
            success:function(rsp){
                var data1=rsp.obj;
                var str='';
                var str1='';
                if(data1.length > 0){
                    for(var i=0;i<data1.length;i++){
                        str+='<li class="otherLi" boxId="'+data1[i].boxId+'"><a href="javascript:;"><img src="../img/commonTheme/${sessionScope.InterfaceModel}/icon_file_11.png"/>'+data1[i].boxName+'</a></li>';
                        str1+='<li class="RemoveTo_child" boxId="'+data1[i].boxId+'">'+data1[i].boxName+'</li>';
                    }
                    $('.other .ul_show ul').html(str);
                    $('.up_nav .RemoveTo_div ul').html(str1);
                }
            }
        })
    }

    function showAndHide(){
        //图标切换
        if($('.UP_INBOX').css('display') == 'none'){
            $('#ul_imgs').attr('src','/img/commonTheme/${sessionScope.InterfaceModel}/icon_zuoyou_sel_03.png');
            $('#ul_img').attr('src','../../img/iCon_list_003.png');
        }else{
            $('#ul_imgs').attr('src','../../img/icon_zuoyou_03.png');
            $('#ul_img').attr('src','../../img/icon_list_sel_03.png');
        }
    }
</script>


<script>
    $(".a_post").on("click",function(event){
        event.preventDefault();  // 使a自带的方法失效，即无法向addStudent.action发出请求
        $.ajax({
            type: "POST",  // 使用post方式
            url: "addStudent.action",
            contentType:"application/json",
            data: JSON.stringify({param1:value1, param2:value2}),  // 参数列表，stringify()方法用于将JS对象序列化为json字符串
            dataType:"json",
            success: function(result){
                // 请求成功后的操作
            },
            error: function(result){
                // 请求失败后的操作
            }
        });
    });
    
</script>
</body>
</html>
